﻿<Application x:Class="VmroleAuthor.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:vw="clr-namespace:VmroleAuthor.Views"
             xmlns:vm="clr-namespace:VmroleAuthor.ViewModels"
            >
    <Application.Resources>
        <DataTemplate DataType="{x:Type ValidationError}">
            <TextBlock TextWrapping="Wrap" FontStyle="Italic" Foreground="Red" HorizontalAlignment="Left" VerticalAlignment="Center" Text="{Binding Path=ErrorContent}"  />
        </DataTemplate>
        <Style x:Key="ControlStyle" TargetType="Control">
            <Setter Property="HorizontalAlignment" Value="Left"/>
            <Setter Property="VerticalAlignment" Value="Top"/>
        </Style>
        <Style BasedOn="{StaticResource ControlStyle}" TargetType="Label">           
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="VerticalAlignment" Value="Top"/>
            <Setter Property="Foreground" Value="DarkBlue"/>           
        </Style>
        <Style x:Key="CheckBoxStyle" BasedOn="{StaticResource ControlStyle}" TargetType="CheckBox">
            <Setter Property="Foreground" Value="DarkBlue"/>
        </Style>
        <Style TargetType="TextBlock">
            <Setter Property="HorizontalAlignment" Value="Left"/>
            <Setter Property="VerticalAlignment" Value="Top"/>
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="Foreground" Value="DarkBlue"/>
        </Style>        

        <DataTemplate DataType="{x:Type vm:VmRoleResourceExtensionViewModel}">
            <vw:VmRoleResourceExtensionView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:VmRoleResourceDefinitionViewModel}">
            <vw:VmRoleResourceDefinitionView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:ResourceExtensionDataPackageViewModel}">
            <vw:ResourceExtensionDataPackageView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:ResourceExtensionRequirementsViewModel}">
            <vw:ResourceExtensionRequirementsView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:ParametersViewModel}">
            <vw:ParametersView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:ApplicationProfileViewModel}">
            <vw:ApplicationProfileView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:WebDeployApplicationViewModel}">
            <vw:WebDeployApplicationView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:ScriptApplicationViewModel}">
            <vw:ScriptApplicationView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:ProvisioningScriptViewModel}">
            <vw:ProvisioningScriptView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:SqlDacApplicationViewModel}">
            <vw:SqlDacApplicationView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:SqlScriptViewModel}">
            <vw:SqlScriptView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:SqlDeploymentViewModel}">
            <vw:SqlDeploymentView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:SqlProfileViewModel}">
            <vm:SqlProfileView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:RunOnceCommandsViewModel}">
            <vw:RunOnceCommandsView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:WindowsServerRolesAndFeaturesViewModel}">
            <vw:WindowsRolesAndFeaturesView />
        </DataTemplate>

        <DataTemplate DataType="{x:Type vm:ReferencedApplicationPayloadViewModel}">
            <vw:ReferencedApplicationPayloadView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:StringParameterizableProperty}">
            <vw:ParameterizablePropertyView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:BoolParameterizableProperty}">
            <vw:ParameterizablePropertyView />
        </DataTemplate>       
        <DataTemplate DataType="{x:Type vm:IntParameterizableProperty}">
            <vw:ParameterizablePropertyView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:CredentialParameterizableProperty}">
            <vw:ParameterizablePropertyView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:EnumParameterizableProperty}">
            <vw:ParameterizablePropertyView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:DiskParameterizableProperty}">
            <vw:ParameterizablePropertyView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:ResourceExtensionReferenceViewModel}">
            <vw:ResourceExtensionReferenceView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:HardwareProfileViewModel}">
            <vw:HardwareProfileView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:ScaleOutSettingsViewModel}">
            <vw:ScaleOutSettingsView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:StorageProfileViewModel}">
            <vw:StorageProfileView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:NetworkProfileViewModel}">
            <vw:NetworkProfileView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:NetworkAdapterViewModel}">
            <vw:NetworkAdapterView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:LoadBalancerConfigurationViewModel}">
            <vw:LoadBalancerConfigurationView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:OperatingSystemProfileViewModel}">
            <vw:OperatingSystemProfileView />
        </DataTemplate>

        <DataTemplate DataType="{x:Type vm:ViewDefParameterLocalizablePropertyViewModel}">
            <vw:ViewDefLocalizableParameterView />
        </DataTemplate>

        <DataTemplate DataType="{x:Type vm:ViewDefViewModel}">
            <vw:ViewDefView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:ViewDefSectionViewModel}">
            <vw:ViewDefSectionView />
        </DataTemplate>
        <DataTemplate DataType="{x:Type vm:ViewDefCategoryViewModel}">
            <vw:ViewDefCategoryView />
        </DataTemplate>

        <DataTemplate x:Key="ViewDefStringParameterTypeTemplate" DataType="{x:Type vm:ViewDefParameterViewModel}">
            <vw:ViewDefStringParameterTypeView />
        </DataTemplate>

        <DataTemplate x:Key="ViewDefMultilineStringParameterTypeTemplate" DataType="{x:Type vm:ViewDefParameterViewModel}">
            <vw:ViewDefMultilineStringParameterTypeView />
        </DataTemplate>

        <DataTemplate x:Key="ViewDefNumberParameterTypeTemplate" DataType="{x:Type vm:ViewDefParameterViewModel}">
            <vw:ViewDefNumberParameterTypeView />
        </DataTemplate>

        <DataTemplate x:Key="ViewDefSimpleParameterTypeTemplate" DataType="{x:Type vm:ViewDefParameterViewModel}">
            <vw:ViewDefSimpleParameterTypeView />
        </DataTemplate>

        <DataTemplate x:Key="ViewDefOsvhdParameterTypeTemplate" DataType="{x:Type vm:ViewDefParameterViewModel}">
            <vw:ViewDefOSVHDParameterTypeView />
        </DataTemplate>
        <DataTemplate x:Key="ViewDefOptionParameterTypeTemplate" DataType="{x:Type vm:ViewDefParameterViewModel}">
            <vw:ViewDefOptionParameterTypeView />
        </DataTemplate>

        <DataTemplate DataType="{x:Type vm:ViewDefParameterViewModel}">
            <ContentControl Content="{Binding }">
                <ContentControl.Style>
                    <Style TargetType="{x:Type ContentControl}">
                        <Setter Property="ContentTemplate" Value="{StaticResource ViewDefStringParameterTypeTemplate}" />
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding Type}" Value="ComputerNamePattern">
                                <Setter Property="ContentTemplate" Value="{StaticResource ViewDefStringParameterTypeTemplate}" />
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Type}" Value="String">
                                <Setter Property="ContentTemplate" Value="{StaticResource ViewDefStringParameterTypeTemplate}" />
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Type}" Value="SecureString">
                                <Setter Property="ContentTemplate" Value="{StaticResource ViewDefStringParameterTypeTemplate}" />
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Type}" Value="MultiLineString">
                                <Setter Property="ContentTemplate" Value="{StaticResource ViewDefMultilineStringParameterTypeTemplate}" />
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Type}" Value="Credential">
                                <Setter Property="ContentTemplate" Value="{StaticResource ViewDefStringParameterTypeTemplate}" />
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Type}" Value="Number">
                                <Setter Property="ContentTemplate" Value="{StaticResource ViewDefNumberParameterTypeTemplate}" />
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Type}" Value="Boolean">
                                <Setter Property="ContentTemplate" Value="{StaticResource ViewDefSimpleParameterTypeTemplate}" />
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Type}" Value="VMSize">
                                <Setter Property="ContentTemplate" Value="{StaticResource ViewDefSimpleParameterTypeTemplate}" />
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Type}" Value="OSVirtualHardDisk">
                                <Setter Property="ContentTemplate" Value="{StaticResource ViewDefOsvhdParameterTypeTemplate}" />
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Type}" Value="Option">
                                <Setter Property="ContentTemplate" Value="{StaticResource ViewDefOptionParameterTypeTemplate}" />
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Type}" Value="DataVirtualHardDisk">
                                <Setter Property="ContentTemplate" Value="{StaticResource ViewDefSimpleParameterTypeTemplate}" />
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Type}" Value="Network">
                                <Setter Property="ContentTemplate" Value="{StaticResource ViewDefSimpleParameterTypeTemplate}" />
                            </DataTrigger>
                            <DataTrigger Binding="{Binding Type}" Value="OSTimeZone">
                                <Setter Property="ContentTemplate" Value="{StaticResource ViewDefSimpleParameterTypeTemplate}" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </ContentControl.Style>
            </ContentControl>
        </DataTemplate>

        <DataTemplate DataType="{x:Type vm:ViewDefResourcesContainerViewModel}">
            <vw:ViewDefResourcesContainerView />
        </DataTemplate>

        <DataTemplate DataType="{x:Type vm:ViewDefResourcesViewModel}">
            <vw:ViewDefResourcesView />
        </DataTemplate>

        <DataTemplate  x:Key="ErrorTemplate">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="20"/>
                    <ColumnDefinition Width="6"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Image Grid.Column="0" Source="..\Img\error.png" Grid.Row="0" VerticalAlignment="Center" Width="20" Height="20"></Image>
                <TextBlock Foreground="{x:Static SystemColors.WindowTextBrush}" Grid.Column="2" Grid.Row="0" 
                           VerticalAlignment="Center" Text="{Binding Message}" FontSize="12" ToolTip="{Binding Message}"/>
            </Grid>
        </DataTemplate>
        <DataTemplate  x:Key="WarningTemplate">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="20"/>
                    <ColumnDefinition Width="6"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Image Grid.Column="0" Source="..\Img\warning.png" Grid.Row="0" VerticalAlignment="Center" Width="20" Height="20"></Image>
                <TextBlock Foreground="{x:Static SystemColors.WindowTextBrush}" Grid.Column="2" Grid.Row="0" 
                           VerticalAlignment="Center" Text="{Binding Message}" FontSize="12" ToolTip="{Binding Message}"/>
            </Grid>
        </DataTemplate>
        <DataTemplate  x:Key="SuccessTemplate">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="20"/>
                    <ColumnDefinition Width="6"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Image Grid.Column="0" Source="..\Img\success.png" Grid.Row="0" VerticalAlignment="Center" Width="20" Height="20"></Image>
                <TextBlock Foreground="{x:Static SystemColors.WindowTextBrush}" Grid.Column="2" Grid.Row="0" 
                           VerticalAlignment="Center" Text="{Binding Message}" FontSize="12" ToolTip="{Binding Message}"/>
            </Grid>
        </DataTemplate>
        <DataTemplate  x:Key="PendingTemplate">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="20"/>
                    <ColumnDefinition Width="6"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <Image Grid.Column="0" Grid.Row="0" Source="..\Img\pending.png" VerticalAlignment="Center" Width="20" Height="20"></Image>
                <TextBlock Foreground="{x:Static SystemColors.HotTrackBrush}" Grid.Column="2" Grid.Row="0" 
                           VerticalAlignment="Center" Text="{Binding Message}" FontSize="12" ToolTip="{Binding Message}"/>
            </Grid>
        </DataTemplate>

        <DataTemplate  x:Key="NormalTitleTemplate">
            <TextBlock Foreground="{x:Static SystemColors.WindowTextBrush}" Text="DEPLOYMENT SUMMARY" FontSize="14" 
                       ToolTip="DEPLOYMENT SUMMARY"/>
        </DataTemplate>

        <DataTemplate  x:Key="PendingTitleTemplate">
            <TextBlock Foreground="{x:Static SystemColors.MenuHighlightBrush}" Text="DEPLOYMENT IN PROGRESS, PLEASE DO NOT CLOSE THIS WINDOW" FontSize="14" 
                       ToolTip="DEPLOYMENT IN PROGRESS, PLEASE DO NOT CLOSE THIS WINDOW"/>
        </DataTemplate>
            
        <DataTemplate x:Key="ResExtDeploymentStringParameterTypeTemplate" DataType="{x:Type vm:ResExtDeploymentParamSettingViewModel}">
            <vw:ResExtDeploymentStringParameterView />
        </DataTemplate>
        <DataTemplate x:Key="ResExtDeploymentMultiLineStringParameterTypeTemplate" DataType="{x:Type vm:ResExtDeploymentParamSettingViewModel}">
            <vw:ResExtDeploymentMultiLineStringParameterView />
        </DataTemplate>
        <DataTemplate x:Key="ResExtDeploymentCredentialParameterTypeTemplate" DataType="{x:Type vm:ResExtDeploymentParamSettingViewModel}">
            <vw:ResExtDeploymentCredentialParameterView />
        </DataTemplate>
        <DataTemplate x:Key="ResExtDeploymentSecureStringParameterTypeTemplate" DataType="{x:Type vm:ResExtDeploymentParamSettingViewModel}">
            <vw:ResExtDeploymentSecureStringParameterView />
        </DataTemplate>
        <DataTemplate x:Key="ResExtDeploymentOptionParameterTypeTemplate" DataType="{x:Type vm:ResExtDeploymentParamSettingViewModel}">
            <vw:ResExtDeploymentOptionParameterView />
        </DataTemplate>
       
        <DataTemplate DataType="{x:Type vm:ResExtDeploymentParamSettingViewModel}">
            <ContentControl Content="{Binding }">
                <ContentControl.Style>
                    <Style TargetType="{x:Type ContentControl}">
                        <Setter Property="ContentTemplate" Value="{StaticResource ResExtDeploymentStringParameterTypeTemplate}" />
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding DefaultViewDefType}" Value="String">
                                <Setter Property="ContentTemplate" Value="{StaticResource ResExtDeploymentStringParameterTypeTemplate}" />
                            </DataTrigger>
                            <DataTrigger Binding="{Binding DefaultViewDefType}" Value="MultiLineString">
                                <Setter Property="ContentTemplate" Value="{StaticResource ResExtDeploymentMultiLineStringParameterTypeTemplate}" />
                            </DataTrigger>
                            <DataTrigger Binding="{Binding DefaultViewDefType}" Value="SecureString">
                                <Setter Property="ContentTemplate" Value="{StaticResource ResExtDeploymentSecureStringParameterTypeTemplate}" />
                            </DataTrigger>                            
                            <DataTrigger Binding="{Binding DefaultViewDefType}" Value="Credential">
                                <Setter Property="ContentTemplate" Value="{StaticResource ResExtDeploymentCredentialParameterTypeTemplate}" />
                            </DataTrigger>
                            <DataTrigger Binding="{Binding DefaultViewDefType}" Value="Number">
                                <Setter Property="ContentTemplate" Value="{StaticResource ResExtDeploymentStringParameterTypeTemplate}" />
                            </DataTrigger>
                            <DataTrigger Binding="{Binding DefaultViewDefType}" Value="Boolean">
                                <Setter Property="ContentTemplate" Value="{StaticResource ResExtDeploymentOptionParameterTypeTemplate}" />
                            </DataTrigger>
                            <DataTrigger Binding="{Binding DefaultViewDefType}" Value="Option">
                                <Setter Property="ContentTemplate" Value="{StaticResource ResExtDeploymentOptionParameterTypeTemplate}" />
                            </DataTrigger>                           
                        </Style.Triggers>
                    </Style>
                </ContentControl.Style>
            </ContentControl>
        </DataTemplate>


    </Application.Resources>
</Application>
